import aepApiRequest from '../utils/aepApiRequest';

interface IParams {
  condition?: string;
  current: number;
  query: {
    logType: number;
    mac: string;
    productKey: string;
    beginTime: string;
    endTime: string;
  };
  size: number;
}

export async function logPage({
  condition,
  current,
  query,
  size,
}: IParams) {
  const params = {
    condition,
    current,
    query,
    size,
  };
  return aepApiRequest('app/smartHome/logPage', {
    method: 'POST',
    body: params,
  });
}

export interface ILogDate {
  date: string;
  mac: string;
  productKey: string;
}

export async function logDate(params: ILogDate) {
  return aepApiRequest('app/device/log/date', {
    method: 'POST',
    body: params,
  });
}
